/**
 * Created by henian.xu on 2017/7/3 0003.
 * 按钮类
 */
$buttonHeight: 30px;
a.#{$pf}btn {
    text-decoration: none;
}

.#{$pf}btn {
    display: inline-block;
    cursor: pointer;
    background: #fff none;
    border: 1px solid $color-border;
    vertical-align: middle;
    outline: 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    padding: ($buttonHeight - 2 - 14 * 1.5) / 2 $padding;

    &:hover {
        background-color: $gray1;
    }
    &:active {
        background-color: $gray2;
    }

    > .#{$pf}icon {
        margin: 0 4px;
    }
}

// 生成不同颜色的按钮
@mixin make-button-style($name,$bg,$bc,$tc) {
    .#{$pf}btn-#{$name} {
        background-color: $bg;
        border-color: $bc;
        color: $tc;
        &:hover {
            background-color: darken($bg, 5%);
        }
        &:active {
            background-color: darken($bg, 10%);
        }
    }

}

@include make-button-style('main', $color-main, darken($color-main, 15%), #fff)
@include make-button-style('second', $color-second, darken($color-second, 15%), #fff)


// 大小
.#{$pf}btn-small {
    font-size: 12px;
    line-height: 1.5;
    padding: (26px - 2 - 12 * 1.5) / 2 $padding * .46;
}

.#{$pf}btn-big {
    font-size: 18px;
    line-height: 1.5;
    padding: (40px - 2 - 18 * 1.5) / 2 $padding * 1.46;
}

// 按钮组
.#{$pf}btn-group {
    display: inline-block;
    > .#{$pf}btn {
        float: left;
        margin-left: -1px;

        &:first-child {
            margin-left: 0;
        }
    }

    // 两端对齐
    &.#{$pf}btn-group-justified {
        display: table;
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        > .#{$pf}btn {
            display: table-cell;
            float: none;
            width: 1%;
        }
    }
}
